package com.monkey.controller;

import com.monkey.service.TagService;
import com.monkey.vo.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author：monkey-L
 * @description: .
 * @date: 17:28 2021/10/4
 */
@RestController
@RequestMapping("tags")
public class TagsController {

    @Autowired
    private TagService tagService;
    @GetMapping("hot")
    public Results hot(){
        //查询最热标签前limit条
        int limit = 6;
        return tagService.hots(limit);
    }

    @GetMapping
    public Results findAll(){
        return tagService.findAll();
    }

    @GetMapping("detail")
    public Results findAllDetail(){
        return tagService.findAllDetail();
    }

    @GetMapping("detail/{id}")
    public Results findDetailById(@PathVariable Long id){
        return tagService.findDetailById(id);
    }
}
